<?php

namespace App\Transformers\Admin;

use App\Http\Requests\ApiRequest;
use League\Fractal\TransformerAbstract;
use App\Models\Goods;

class AddGoodsRequest  extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 传递参数 验证规则
     *
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'goodsCategoryId' => 'integer|required',
            'selectGroupPics' => 'required',
            'logoPics' => 'required',
        ];
    }


    /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'goodsCategoryId.required'=>'请选择分类',
            'goodsCategoryId.integer'=>'分类参数错误',
            'selectGroupPics.required'=>'请上传展示图组',
            'logoPics.required'=>'请上传logo图片',
        ];
    }
}
